<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>easy-press</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <style>
        a{
            color: #333;
            text-decoration: none;
        }
        a:hover{
            text-decoration: underline;
        }
        a:visited{
            color: #999;
        }
        .post-list{
            margin: 0 auto;
            max-width: 600px;
            padding: 20px 15px;
        }
        .post{
            min-height: 100px;
            color: #999;
            padding: 15px 2px 20px 0;
            border-bottom: 1px solid #f0f0f0;
        }
        .post .title{
            height: 30px;
            font-size: 18px;
            color: #333;;
        }
        .post .desc{
            min-height: 50px;
            color: #999;
            font-size: 13px;
            line-height: 24px;
        }
        .post .meta{
            font-size: 12px;
            font-weight: 400;
            line-height: 20px;
        }
        .ctrl{
            text-align: center;
            margin: 0 auto;
            background: #eee;
            width: 180px;
            height: 180px;
            display: flex;
            align-items: flex-start;
            /* text-align: center; */
            padding: 50px 40px;
            box-sizing: border-box;
            justify-content: flex-end;
            position: fixed;
            bottom: -90px;
            left: -90px;
            border-radius: 90px;
        }
    </style>
</head>
<body>
<#macro replaceHtml str>
    <#assign a=str?replace("<.*?>","","r")>
    <#assign a=a?replace("&nbsp;","")>
    <#assign a=a?replace(" ","")>
    ${a} ...
</#macro>
<div class="post-list">
    <#list page.content as post>
         <div class="post">
             <div class="title"><a href="/p/${post.id}">${post.title}</a></div>
             <div class="desc">
                   <#if   (post.content?length>100)>
                       <@replaceHtml post.content?substring(0,100)></@replaceHtml>
                   <#else >
                       <@replaceHtml post.content></@replaceHtml>
                   </#if>
             </div>
             <div class="meta">${post.createdDate} <div style="float: right"><a href="/admin/p/${post.id}">編輯</a></div></div>
         </div>
    </#list>
</div>
<div class="ctrl">

    <a href="/admin">新增</a>
</div>
</body>
</html>